package com.zwan.oam_rtc.utils.messages;

import com.zwan.oam_rtc.utils.wintcp.ByteTransfer;

import java.nio.ByteBuffer;

/***
 * 用户信息查询消息
 *
 */

public class CustomerInfoMessage extends AbstractStruct {
    
//    callflowid	Varchar2(20)
//    callbackurl	Varchar2(300)
//    Callstatus	Integer

    private byte[] messageBodyHeader = new byte[8];
    private byte[] customernumber = new byte[29];


    private static int LENGTH = 37;
    
    /**
     * 返回消息写入buffer
     */
    @Override
    public void writeToBuffer(ByteBuffer bf) {
        bf.put(messageBodyHeader);
        bf.put(customernumber);
    }

    /**
     * buffer读出返回消息
     */
    @Override
    public void readFromBuffer(ByteBuffer bf) {
        bf.get(messageBodyHeader);
        bf.get(customernumber);
    }


    @Override
    public int getLength() {
        return LENGTH;
    }


    public String getCustomernumber() {return  ByteTransfer.getString(customernumber); }

    public byte[] getMessageBodyHeader() {
        return messageBodyHeader;
    }
}
